home *** CD-ROM | disk | FTP | other *** search
-
- // Copyright (C) 2002 by Luigi Pino. All Rights Reserved.
-
- /***************************************************************************/
-
- typedef struct {
- color3 color; // Color of light
- float brightness; // Brightness of light
- float range; // Range of influence
- float3 position; // Position
- } Shadow_Box_Struct;
-
- typedef struct {
- color3 c_new; // Updated color values
- color3 c_old; // Original color values
- color3 c_lit; // Lighted color values
- float2 percent; // Percent of texture coordinate
- float3 position; // Position
- int angle_x; // Temp angle_x for shadow calculations
- int angle_y; // Temp angle_y for shadow calculations
- } Point_Struct;
-
- /***************************************************************************/
-
- class Object3_Class {
- public:
- Object3_Class(); // Constructor
- ~Object3_Class(); // Deconstructor
-
- void Calculate_Light(Shadow_Box_Struct *light);
- void Calculate_Normal();
- void Color();
- void Draw();
- void Fade(float amount);
- void Finalize_Light();
- float3 Get_Base();
- float3 Get_Center(int index);
- int Get_Mesh(int index);
- vector3 Get_Normal(int index, int normal_index);
- int Get_Plane_Collision(int index, float3 *point);
- float Get_Plane_Distance(int index, int normal_index, float3 *point);
- float3 Get_Position(int index, int point_index);
- int Get_Size();
- int Get_Texture_Image();
- float2 Get_Texture_Position(int index, int point_index);
- void Initialize_Light();
- void Load_Model(char *file, int image);
- void Move(float3 *vector);
- bool Oct_Tree(int index, Object3_Class *destination, float2 *high_bound, float2 *low_bound);
- void Rotate_x(float amount);
- void Rotate_y(float amount);
- void Rotate_z(float amount);
- void Set_Alpha(int index, float alpha_value);
- void Set_Base(float3 *base_point);
- void Set_Color(int index, color3 *color0, color3 *color1, color3 *color2);
- void Set_Mesh(int index, int mesh_number);
- void Set_Position(int index, float3 *point0, float3 *point1, float3 *point2);
- bool Set_Size(int size);
- void Set_Texture_Image(int image);
- void Set_Texture_Position(int index, float2 *percent0, float2 *percent1, float2 *percent2);
-
- private:
- typedef struct {
- Point_Struct point[3]; // Points
- float alpha; // Alpha value
- float3 center; // Center
- int mesh; // To distinguish model parts
- vector3 normal[4]; // Normal
- } Polygon3_Struct;
-
- Polygon3_Struct *tri; // Triangle pointer
- float3 base; // Base point of object
- int texture_image; // Texture image
- int size; // Size of list
-
- void Initialize_Polygon(int index);
- };
-
- /***************************************************************************/
-
- class Object4_Class {
- public:
- Object4_Class(); // Constructor
- ~Object4_Class(); // Deconstructor
-
- void Calculate_Light(Shadow_Box_Struct *light);
- void Calculate_Normal();
- void Color();
- void Draw();
- void Fade(float amount);
- void Finalize_Light();
- float3 Get_Base();
- float3 Get_Center(int index);
- vector3 Get_Normal(int index, int normal_index);
- int Get_Plane_Collision(int index, float3 *point);
- float Get_Plane_Distance(int index, int normal_index, float3 *point);
- float3 Get_Position(int index, int point_index);
- int Get_Size();
- void Initialize_Light();
- void Initialize_Polygon(int index);
- void Move(float3 *vector);
- void Set_Alpha(int index, float alpha_value);
- void Set_Base(float3 *base_point);
- void Set_Color(int index, float color0r, float color0g, float color0b, float color1r, float color1g,
- float color1b, float color2r, float color2g, float color2b, float color3r, float color3g,
- float color3b);
- void Set_Position(int index, float point0x, float point0y, float point0z, float point1x, float point1y,
- float point1z, float point2x, float point2y, float point2z, float point3x, float point3y,
- float point3z);
- bool Set_Size(int size);
- void Set_Texture_Image(int image);
- void Set_Texture_Position(int index, float percent0x, float percent0y, float percent1x, float percent1y,
- float percent2x, float percent2y, float percent3x, float percent3y);
-
- private:
- typedef struct {
- Point_Struct point[4]; // Points
- float alpha; // Alpha value
- float3 center; // Center
- vector3 normal[5]; // Normal
- } Polygon4_Struct;
-
- Polygon4_Struct *quad; // Quad pointer
- float3 base; // Base point of object
- int texture_image; // Texture image
- int size; // Size of list
- };
-
- /***************************************************************************/
-
- void Quad_Color(float top_left_x, float top_left_y, float top_left_z, float top_right_x, float top_right_y,
- float top_right_z, float bottom_right_x, float bottom_right_y, float bottom_right_z, float bottom_left_x,
- float bottom_left_y, float bottom_left_z, float r, float g, float b, float a);
-
- void Quad_Texture(int image, float top_left_x, float top_left_y, float top_left_z, float top_right_x, float top_right_y,
- float top_right_z, float bottom_right_x, float bottom_right_y, float bottom_right_z, float bottom_left_x,
- float bottom_left_y, float bottom_left_z, float top_left_percent_x, float top_left_percent_y,
- float top_right_percent_x, float top_right_percent_y, float bottom_right_percent_x,
- float bottom_right_percent_y, float bottom_left_percent_x, float bottom_left_percent_y,
- float r, float g, float b);
-
- void Tri_Texture(int image, float top_left_x, float top_left_y, float top_left_z, float top_right_x, float top_right_y,
- float top_right_z, float bottom_left_x, float bottom_left_y, float bottom_left_z,
- float top_left_percent_x, float top_left_percent_y, float top_right_percent_x, float top_right_percent_y,
- float bottom_left_percent_x, float bottom_left_percent_y, float r, float g, float b);
-
- /***************************************************************************/